<template>
  <div id="addressbook">
    <el-container>
      <el-aside width="200px">
        <el-menu default-active="/home/addressbook/personal" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" background-color="#F6F9FE" text-color="#506480" active-text-color="#488CEE" :router="true">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-notebook-1"></i>
              <span>个人通讯录</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/home/addressbook/personal">全部</el-menu-item>
              <el-menu-item index="/home/addressbook/personal_group">分组管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-menu-item index="/home/addressbook/corporate">
            <i class="el-icon-notebook-1"></i>
            <span slot="title">单位通讯录</span>
          </el-menu-item>
          <el-submenu index="/home/addressbook/public">
            <template slot="title">
              <i class="el-icon-notebook-1"></i>
              <span>公共通讯录</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/home/addressbook/public">全部</el-menu-item>
              <el-menu-item index="/home/addressbook/public_group">分组管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-main>

        <router-view />
      </el-main>
    </el-container>
  </div>
</template>
<style scoped>
.el-aside {
  background-color: #f6f9fe;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #f2f2f2;
  color: #333;
  text-align: center;
  line-height: 160px;
}
.el-container,
#addressbook,
.el-aside,
.el-main {
  height: 100%;
  text-align: left;
  line-height: 16px;
}
</style>
<script>
export default {
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
  data() {
    return {};
  },
};
</script>
